3.1.66 \(\int (c+d \tan (e+f x))^3 (A+B \tan (e+f x)+C \tan ^2(e+f x)) \, dx\) [66]

Optimal. Leaf size=191 \[ -\left (\left (c^3 C+3 B c^2 d-3 c C d^2-B d^3-A \left (c^3-3 c d^2\right )\right ) x\right )-\frac {\left ((A-C) d \left (3 c^2-d^2\right )+B \left (c^3-3 c d^2\right )\right ) \log (\cos (e+f x))}{f}+\frac {d \left (2 c (A-C) d+B \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}+\frac {(B c+(A-C) d) (c+d \tan (e+f x))^2}{2 f}+\frac {B (c+d \tan (e+f x))^3}{3 f}+\frac {C (c+d \tan (e+f x))^4}{4 d f} \]

[Out]

-(c^3*C+3*B*c^2*d-3*c*C*d^2-B*d^3-A*(c^3-3*c*d^2))*x-((A-C)*d*(3*c^2-d^2)+B*(c^3-3*c*d^2))*ln(cos(f*x+e))/f+d*
(2*c*(A-C)*d+B*(c^2-d^2))*tan(f*x+e)/f+1/2*(B*c+(A-C)*d)*(c+d*tan(f*x+e))^2/f+1/3*B*(c+d*tan(f*x+e))^3/f+1/4*C
*(c+d*tan(f*x+e))^4/d/f

________________________________________________________________________________________

Rubi [A]
time = 0.17, antiderivative size = 191, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.121, Rules used = {3711, 3609, 3606, 3556} \begin {gather*} \frac {d \tan (e+f x) \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )}{f}-\frac {\left (d (A-C) \left (3 c^2-d^2\right )+B \left (c^3-3 c d^2\right )\right ) \log (\cos (e+f x))}{f}-x \left (-A \left (c^3-3 c d^2\right )+3 B c^2 d-B d^3+c^3 C-3 c C d^2\right )+\frac {(d (A-C)+B c) (c+d \tan (e+f x))^2}{2 f}+\frac {B (c+d \tan (e+f x))^3}{3 f}+\frac {C (c+d \tan (e+f x))^4}{4 d f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*Tan[e + f*x])^3*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2),x]

[Out]

-((c^3*C + 3*B*c^2*d - 3*c*C*d^2 - B*d^3 - A*(c^3 - 3*c*d^2))*x) - (((A - C)*d*(3*c^2 - d^2) + B*(c^3 - 3*c*d^
2))*Log[Cos[e + f*x]])/f + (d*(2*c*(A - C)*d + B*(c^2 - d^2))*Tan[e + f*x])/f + ((B*c + (A - C)*d)*(c + d*Tan[
e + f*x])^2)/(2*f) + (B*(c + d*Tan[e + f*x])^3)/(3*f) + (C*(c + d*Tan[e + f*x])^4)/(4*d*f)

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3606

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[b*d*(Tan[e + f*x]/f), x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3609

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[d*
((a + b*Tan[e + f*x])^m/(f*m)), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rule 3711

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> Simp[C*((a + b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Int[(a + b*Tan[e + f*x])
^m*Simp[A - C + B*Tan[e + f*x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0]
&&  !LeQ[m, -1]

Rubi steps

\begin {align*} \int (c+d \tan (e+f x))^3 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx &=\frac {C (c+d \tan (e+f x))^4}{4 d f}+\int (A-C+B \tan (e+f x)) (c+d \tan (e+f x))^3 \, dx\\ &=\frac {B (c+d \tan (e+f x))^3}{3 f}+\frac {C (c+d \tan (e+f x))^4}{4 d f}+\int (c+d \tan (e+f x))^2 (A c-c C-B d+(B c+(A-C) d) \tan (e+f x)) \, dx\\ &=\frac {(B c+(A-C) d) (c+d \tan (e+f x))^2}{2 f}+\frac {B (c+d \tan (e+f x))^3}{3 f}+\frac {C (c+d \tan (e+f x))^4}{4 d f}+\int (c+d \tan (e+f x)) \left (-c^2 C-2 B c d+C d^2+A \left (c^2-d^2\right )+\left (2 c (A-C) d+B \left (c^2-d^2\right )\right ) \tan (e+f x)\right ) \, dx\\ &=-\left (c^3 C+3 B c^2 d-3 c C d^2-B d^3-A \left (c^3-3 c d^2\right )\right ) x+\frac {d \left (2 c (A-C) d+B \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}+\frac {(B c+(A-C) d) (c+d \tan (e+f x))^2}{2 f}+\frac {B (c+d \tan (e+f x))^3}{3 f}+\frac {C (c+d \tan (e+f x))^4}{4 d f}+\left ((A-C) d \left (3 c^2-d^2\right )+B \left (c^3-3 c d^2\right )\right ) \int \tan (e+f x) \, dx\\ &=-\left (c^3 C+3 B c^2 d-3 c C d^2-B d^3-A \left (c^3-3 c d^2\right )\right ) x-\frac {\left ((A-C) d \left (3 c^2-d^2\right )+B \left (c^3-3 c d^2\right )\right ) \log (\cos (e+f x))}{f}+\frac {d \left (2 c (A-C) d+B \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}+\frac {(B c+(A-C) d) (c+d \tan (e+f x))^2}{2 f}+\frac {B (c+d \tan (e+f x))^3}{3 f}+\frac {C (c+d \tan (e+f x))^4}{4 d f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 1.61, size = 212, normalized size = 1.11 \begin {gather*} \frac {3 C (c+d \tan (e+f x))^4-6 (B c+(-A+C) d) \left ((i c-d)^3 \log (i-\tan (e+f x))-(i c+d)^3 \log (i+\tan (e+f x))+6 c d^2 \tan (e+f x)+d^3 \tan ^2(e+f x)\right )+2 B \left (-3 i (c+i d)^4 \log (i-\tan (e+f x))+3 i (c-i d)^4 \log (i+\tan (e+f x))-6 d^2 \left (-6 c^2+d^2\right ) \tan (e+f x)+12 c d^3 \tan ^2(e+f x)+2 d^4 \tan ^3(e+f x)\right )}{12 d f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*Tan[e + f*x])^3*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2),x]

[Out]

(3*C*(c + d*Tan[e + f*x])^4 - 6*(B*c + (-A + C)*d)*((I*c - d)^3*Log[I - Tan[e + f*x]] - (I*c + d)^3*Log[I + Ta
n[e + f*x]] + 6*c*d^2*Tan[e + f*x] + d^3*Tan[e + f*x]^2) + 2*B*((-3*I)*(c + I*d)^4*Log[I - Tan[e + f*x]] + (3*
I)*(c - I*d)^4*Log[I + Tan[e + f*x]] - 6*d^2*(-6*c^2 + d^2)*Tan[e + f*x] + 12*c*d^3*Tan[e + f*x]^2 + 2*d^4*Tan
[e + f*x]^3))/(12*d*f)

________________________________________________________________________________________

Maple [A]
time = 0.10, size = 265, normalized size = 1.39 Too large to display

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c+d*tan(f*x+e))^3*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x,method=_RETURNVERBOSE)

[Out]

1/f*(1/4*C*d^3*tan(f*x+e)^4+1/3*B*d^3*tan(f*x+e)^3+C*c*d^2*tan(f*x+e)^3+1/2*A*d^3*tan(f*x+e)^2+3/2*B*c*d^2*tan
(f*x+e)^2+3/2*C*c^2*d*tan(f*x+e)^2-1/2*C*d^3*tan(f*x+e)^2+3*A*c*d^2*tan(f*x+e)+3*B*c^2*d*tan(f*x+e)-B*d^3*tan(
f*x+e)+c^3*C*tan(f*x+e)-3*c*C*d^2*tan(f*x+e)+1/2*(3*A*c^2*d-A*d^3+B*c^3-3*B*c*d^2-3*C*c^2*d+C*d^3)*ln(1+tan(f*
x+e)^2)+(A*c^3-3*A*c*d^2-3*B*c^2*d+B*d^3-C*c^3+3*C*c*d^2)*arctan(tan(f*x+e)))

________________________________________________________________________________________

Maxima [A]
time = 0.52, size = 208, normalized size = 1.09 \begin {gather*} \frac {3 \, C d^{3} \tan \left (f x + e\right )^{4} + 4 \, {\left (3 \, C c d^{2} + B d^{3}\right )} \tan \left (f x + e\right )^{3} + 6 \, {\left (3 \, C c^{2} d + 3 \, B c d^{2} + {\left (A - C\right )} d^{3}\right )} \tan \left (f x + e\right )^{2} + 12 \, {\left ({\left (A - C\right )} c^{3} - 3 \, B c^{2} d - 3 \, {\left (A - C\right )} c d^{2} + B d^{3}\right )} {\left (f x + e\right )} + 6 \, {\left (B c^{3} + 3 \, {\left (A - C\right )} c^{2} d - 3 \, B c d^{2} - {\left (A - C\right )} d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 12 \, {\left (C c^{3} + 3 \, B c^{2} d + 3 \, {\left (A - C\right )} c d^{2} - B d^{3}\right )} \tan \left (f x + e\right )}{12 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^3*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

1/12*(3*C*d^3*tan(f*x + e)^4 + 4*(3*C*c*d^2 + B*d^3)*tan(f*x + e)^3 + 6*(3*C*c^2*d + 3*B*c*d^2 + (A - C)*d^3)*
tan(f*x + e)^2 + 12*((A - C)*c^3 - 3*B*c^2*d - 3*(A - C)*c*d^2 + B*d^3)*(f*x + e) + 6*(B*c^3 + 3*(A - C)*c^2*d
 - 3*B*c*d^2 - (A - C)*d^3)*log(tan(f*x + e)^2 + 1) + 12*(C*c^3 + 3*B*c^2*d + 3*(A - C)*c*d^2 - B*d^3)*tan(f*x
 + e))/f

________________________________________________________________________________________

Fricas [A]
time = 0.99, size = 206, normalized size = 1.08 \begin {gather*} \frac {3 \, C d^{3} \tan \left (f x + e\right )^{4} + 4 \, {\left (3 \, C c d^{2} + B d^{3}\right )} \tan \left (f x + e\right )^{3} + 12 \, {\left ({\left (A - C\right )} c^{3} - 3 \, B c^{2} d - 3 \, {\left (A - C\right )} c d^{2} + B d^{3}\right )} f x + 6 \, {\left (3 \, C c^{2} d + 3 \, B c d^{2} + {\left (A - C\right )} d^{3}\right )} \tan \left (f x + e\right )^{2} - 6 \, {\left (B c^{3} + 3 \, {\left (A - C\right )} c^{2} d - 3 \, B c d^{2} - {\left (A - C\right )} d^{3}\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 12 \, {\left (C c^{3} + 3 \, B c^{2} d + 3 \, {\left (A - C\right )} c d^{2} - B d^{3}\right )} \tan \left (f x + e\right )}{12 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^3*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

1/12*(3*C*d^3*tan(f*x + e)^4 + 4*(3*C*c*d^2 + B*d^3)*tan(f*x + e)^3 + 12*((A - C)*c^3 - 3*B*c^2*d - 3*(A - C)*
c*d^2 + B*d^3)*f*x + 6*(3*C*c^2*d + 3*B*c*d^2 + (A - C)*d^3)*tan(f*x + e)^2 - 6*(B*c^3 + 3*(A - C)*c^2*d - 3*B
*c*d^2 - (A - C)*d^3)*log(1/(tan(f*x + e)^2 + 1)) + 12*(C*c^3 + 3*B*c^2*d + 3*(A - C)*c*d^2 - B*d^3)*tan(f*x +
 e))/f

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 410 vs. \(2 (163) = 326\).
time = 0.18, size = 410, normalized size = 2.15 \begin {gather*} \begin {cases} A c^{3} x + \frac {3 A c^{2} d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - 3 A c d^{2} x + \frac {3 A c d^{2} \tan {\left (e + f x \right )}}{f} - \frac {A d^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {A d^{3} \tan ^{2}{\left (e + f x \right )}}{2 f} + \frac {B c^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - 3 B c^{2} d x + \frac {3 B c^{2} d \tan {\left (e + f x \right )}}{f} - \frac {3 B c d^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {3 B c d^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} + B d^{3} x + \frac {B d^{3} \tan ^{3}{\left (e + f x \right )}}{3 f} - \frac {B d^{3} \tan {\left (e + f x \right )}}{f} - C c^{3} x + \frac {C c^{3} \tan {\left (e + f x \right )}}{f} - \frac {3 C c^{2} d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {3 C c^{2} d \tan ^{2}{\left (e + f x \right )}}{2 f} + 3 C c d^{2} x + \frac {C c d^{2} \tan ^{3}{\left (e + f x \right )}}{f} - \frac {3 C c d^{2} \tan {\left (e + f x \right )}}{f} + \frac {C d^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {C d^{3} \tan ^{4}{\left (e + f x \right )}}{4 f} - \frac {C d^{3} \tan ^{2}{\left (e + f x \right )}}{2 f} & \text {for}\: f \neq 0 \\x \left (c + d \tan {\left (e \right )}\right )^{3} \left (A + B \tan {\left (e \right )} + C \tan ^{2}{\left (e \right )}\right ) & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))**3*(A+B*tan(f*x+e)+C*tan(f*x+e)**2),x)

[Out]

Piecewise((A*c**3*x + 3*A*c**2*d*log(tan(e + f*x)**2 + 1)/(2*f) - 3*A*c*d**2*x + 3*A*c*d**2*tan(e + f*x)/f - A
*d**3*log(tan(e + f*x)**2 + 1)/(2*f) + A*d**3*tan(e + f*x)**2/(2*f) + B*c**3*log(tan(e + f*x)**2 + 1)/(2*f) -
3*B*c**2*d*x + 3*B*c**2*d*tan(e + f*x)/f - 3*B*c*d**2*log(tan(e + f*x)**2 + 1)/(2*f) + 3*B*c*d**2*tan(e + f*x)
**2/(2*f) + B*d**3*x + B*d**3*tan(e + f*x)**3/(3*f) - B*d**3*tan(e + f*x)/f - C*c**3*x + C*c**3*tan(e + f*x)/f
 - 3*C*c**2*d*log(tan(e + f*x)**2 + 1)/(2*f) + 3*C*c**2*d*tan(e + f*x)**2/(2*f) + 3*C*c*d**2*x + C*c*d**2*tan(
e + f*x)**3/f - 3*C*c*d**2*tan(e + f*x)/f + C*d**3*log(tan(e + f*x)**2 + 1)/(2*f) + C*d**3*tan(e + f*x)**4/(4*
f) - C*d**3*tan(e + f*x)**2/(2*f), Ne(f, 0)), (x*(c + d*tan(e))**3*(A + B*tan(e) + C*tan(e)**2), True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 4300 vs. \(2 (190) = 380\).
time = 2.89, size = 4300, normalized size = 22.51 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^3*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="giac")

[Out]

1/12*(12*A*c^3*f*x*tan(f*x)^4*tan(e)^4 - 12*C*c^3*f*x*tan(f*x)^4*tan(e)^4 - 36*B*c^2*d*f*x*tan(f*x)^4*tan(e)^4
 - 36*A*c*d^2*f*x*tan(f*x)^4*tan(e)^4 + 36*C*c*d^2*f*x*tan(f*x)^4*tan(e)^4 + 12*B*d^3*f*x*tan(f*x)^4*tan(e)^4
- 6*B*c^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan
(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 - 18*A*c^2*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + t
an(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 + 18*C*c^2*d*log(
4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(
e)^2 + 1))*tan(f*x)^4*tan(e)^4 + 18*B*c*d^2*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(
e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 + 6*A*d^3*log(4*(tan(f*x)^4*tan
(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*
x)^4*tan(e)^4 - 6*C*d^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 -
2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 - 48*A*c^3*f*x*tan(f*x)^3*tan(e)^3 + 48*C*c^3*f*x*t
an(f*x)^3*tan(e)^3 + 144*B*c^2*d*f*x*tan(f*x)^3*tan(e)^3 + 144*A*c*d^2*f*x*tan(f*x)^3*tan(e)^3 - 144*C*c*d^2*f
*x*tan(f*x)^3*tan(e)^3 - 48*B*d^3*f*x*tan(f*x)^3*tan(e)^3 + 18*C*c^2*d*tan(f*x)^4*tan(e)^4 + 18*B*c*d^2*tan(f*
x)^4*tan(e)^4 + 6*A*d^3*tan(f*x)^4*tan(e)^4 - 9*C*d^3*tan(f*x)^4*tan(e)^4 + 24*B*c^3*log(4*(tan(f*x)^4*tan(e)^
2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^3
*tan(e)^3 + 72*A*c^2*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2
*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^3*tan(e)^3 - 72*C*c^2*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)
^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^3*tan(e)^3 - 72
*B*c*d^2*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(
e) + 1)/(tan(e)^2 + 1))*tan(f*x)^3*tan(e)^3 - 24*A*d^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(
f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^3*tan(e)^3 + 24*C*d^3*log(4*(ta
n(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2
+ 1))*tan(f*x)^3*tan(e)^3 - 12*C*c^3*tan(f*x)^4*tan(e)^3 - 36*B*c^2*d*tan(f*x)^4*tan(e)^3 - 36*A*c*d^2*tan(f*x
)^4*tan(e)^3 + 36*C*c*d^2*tan(f*x)^4*tan(e)^3 + 12*B*d^3*tan(f*x)^4*tan(e)^3 - 12*C*c^3*tan(f*x)^3*tan(e)^4 -
36*B*c^2*d*tan(f*x)^3*tan(e)^4 - 36*A*c*d^2*tan(f*x)^3*tan(e)^4 + 36*C*c*d^2*tan(f*x)^3*tan(e)^4 + 12*B*d^3*ta
n(f*x)^3*tan(e)^4 + 72*A*c^3*f*x*tan(f*x)^2*tan(e)^2 - 72*C*c^3*f*x*tan(f*x)^2*tan(e)^2 - 216*B*c^2*d*f*x*tan(
f*x)^2*tan(e)^2 - 216*A*c*d^2*f*x*tan(f*x)^2*tan(e)^2 + 216*C*c*d^2*f*x*tan(f*x)^2*tan(e)^2 + 72*B*d^3*f*x*tan
(f*x)^2*tan(e)^2 + 18*C*c^2*d*tan(f*x)^4*tan(e)^2 + 18*B*c*d^2*tan(f*x)^4*tan(e)^2 + 6*A*d^3*tan(f*x)^4*tan(e)
^2 - 6*C*d^3*tan(f*x)^4*tan(e)^2 - 36*C*c^2*d*tan(f*x)^3*tan(e)^3 - 36*B*c*d^2*tan(f*x)^3*tan(e)^3 - 12*A*d^3*
tan(f*x)^3*tan(e)^3 + 24*C*d^3*tan(f*x)^3*tan(e)^3 + 18*C*c^2*d*tan(f*x)^2*tan(e)^4 + 18*B*c*d^2*tan(f*x)^2*ta
n(e)^4 + 6*A*d^3*tan(f*x)^2*tan(e)^4 - 6*C*d^3*tan(f*x)^2*tan(e)^4 - 12*C*c*d^2*tan(f*x)^4*tan(e) - 4*B*d^3*ta
n(f*x)^4*tan(e) - 36*B*c^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2
 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^2*tan(e)^2 - 108*A*c^2*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan
(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^2*tan(e)^2
 + 108*C*c^2*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x
)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^2*tan(e)^2 + 108*B*c*d^2*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(
e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^2*tan(e)^2 + 36*A*d^3*
log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(
tan(e)^2 + 1))*tan(f*x)^2*tan(e)^2 - 36*C*d^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*ta
n(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^2*tan(e)^2 + 36*C*c^3*tan(f*x)^3*tan(e)^
2 + 108*B*c^2*d*tan(f*x)^3*tan(e)^2 + 108*A*c*d^2*tan(f*x)^3*tan(e)^2 - 144*C*c*d^2*tan(f*x)^3*tan(e)^2 - 48*B
*d^3*tan(f*x)^3*tan(e)^2 + 36*C*c^3*tan(f*x)^2*tan(e)^3 + 108*B*c^2*d*tan(f*x)^2*tan(e)^3 + 108*A*c*d^2*tan(f*
x)^2*tan(e)^3 - 144*C*c*d^2*tan(f*x)^2*tan(e)^3 - 48*B*d^3*tan(f*x)^2*tan(e)^3 - 12*C*c*d^2*tan(f*x)*tan(e)^4
- 4*B*d^3*tan(f*x)*tan(e)^4 + 3*C*d^3*tan(f*x)^4 - 48*A*c^3*f*x*tan(f*x)*tan(e) + 48*C*c^3*f*x*tan(f*x)*tan(e)
 + 144*B*c^2*d*f*x*tan(f*x)*tan(e) + 144*A*c*d^2*f*x*tan(f*x)*tan(e) - 144*C*c*d^2*f*x*tan(f*x)*tan(e) - 48*B*
d^3*f*x*tan(f*x)*tan(e) - 36*C*c^2*d*tan(f*x)^3...

________________________________________________________________________________________

Mupad [B]
time = 8.79, size = 221, normalized size = 1.16 \begin {gather*} x\,\left (A\,c^3+B\,d^3-C\,c^3-3\,A\,c\,d^2-3\,B\,c^2\,d+3\,C\,c\,d^2\right )+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (C\,c^3-B\,d^3+3\,A\,c\,d^2+3\,B\,c^2\,d-3\,C\,c\,d^2\right )}{f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (\frac {B\,d^3}{3}+C\,c\,d^2\right )}{f}-\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (\frac {A\,d^3}{2}-\frac {B\,c^3}{2}-\frac {C\,d^3}{2}-\frac {3\,A\,c^2\,d}{2}+\frac {3\,B\,c\,d^2}{2}+\frac {3\,C\,c^2\,d}{2}\right )}{f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {A\,d^3}{2}-\frac {C\,d^3}{2}+\frac {3\,B\,c\,d^2}{2}+\frac {3\,C\,c^2\,d}{2}\right )}{f}+\frac {C\,d^3\,{\mathrm {tan}\left (e+f\,x\right )}^4}{4\,f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*tan(e + f*x))^3*(A + B*tan(e + f*x) + C*tan(e + f*x)^2),x)

[Out]

x*(A*c^3 + B*d^3 - C*c^3 - 3*A*c*d^2 - 3*B*c^2*d + 3*C*c*d^2) + (tan(e + f*x)*(C*c^3 - B*d^3 + 3*A*c*d^2 + 3*B
*c^2*d - 3*C*c*d^2))/f + (tan(e + f*x)^3*((B*d^3)/3 + C*c*d^2))/f - (log(tan(e + f*x)^2 + 1)*((A*d^3)/2 - (B*c
^3)/2 - (C*d^3)/2 - (3*A*c^2*d)/2 + (3*B*c*d^2)/2 + (3*C*c^2*d)/2))/f + (tan(e + f*x)^2*((A*d^3)/2 - (C*d^3)/2
 + (3*B*c*d^2)/2 + (3*C*c^2*d)/2))/f + (C*d^3*tan(e + f*x)^4)/(4*f)

________________________________________________________________________________________